import { createSlice, PayloadAction, createAsyncThunk } from '@reduxjs/toolkit'

let initialState = {
  appid: 0,
  app: {
    list: [
      {
        name: 'Imagetext',
        id: '12324'
      }
    ]
  }
}

const creatorSlice = createSlice({
  name: 'creator',
  initialState,
  reducers: {
    setApp: (state, { payload }) => {
      let app = state.app
      app.list.push(payload)
      state.app = app
    },
  },
})

export const { setApp } = creatorSlice.actions;

export default creatorSlice.reducer
